package ru.gerunn.study.spring.configexample;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

	public static void main(String[] args) {
		@SuppressWarnings("resource")
		ApplicationContext ac = new ClassPathXmlApplicationContext("spring-config-example.xml");

		Helloe11 helloe11 = (Helloe11) ac.getBean("helloe11");

		helloe11.helloe11();

		Singleton singleton = (Singleton) ac.getBean("singleton");
		System.out.println(singleton);
		System.out.println(Singleton.getInstance());

		System.out.println(helloe11.getSixth());
		System.out.println(helloe11.getSeventh());
		System.out.println(helloe11.getEighth());
		System.out.println(helloe11.getNinth());
		System.out.println(helloe11.getTenth());

		SomeClass someClass = (SomeClass) ac.getBean("someClass");
		System.out.println(someClass);

		System.out.println(someClass.getMap().keySet());

		System.out.println(ac.getBean("ooh"));
		System.out.println(ac.getBean("zxc"));

	}

}
